package com.gxa.cart.service;

import com.gxa.cart.pojo.CartItem;
import com.gxa.common.exception.BusinessException;

import java.util.Map;

/**
 * Created by bill on 2021/1/6
 **/
public interface CartService {

    /**
     * 添加商品到购物车
     * @param skuId
     * @param num
     */
    public void addGoodsToCart(Long userId,String  skuId, Integer num)throws BusinessException;

    /**
     * 修改购物项数量
     * @param skuId
     * @param num
     */
    public void updateCartItemNum(Long userId,String  skuId, Integer num);

    /**
     * 移除购物项
     * @param skuId
     */
    public void removeCartItem(Long userId,String  skuId);

    /**
     * 清空购物车
     */
    public void clearCart(Long userId);


    /**
     * 查询购物项
     * @param skuId
     * @return
     */
    public CartItem queryUserCartItem(Long userId,String  skuId)throws BusinessException;

    /**
     * 查询购物车
     * @return
     */
    public Map queryUserCart(Long userId);



}
